//package com.woohua.demo.config;
//
//import com.woohua.demo.remote.api.CommonApi;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.reactive.function.client.ClientRequest;
//import org.springframework.web.reactive.function.client.WebClient;
//import org.springframework.web.reactive.function.client.support.WebClientAdapter;
//import org.springframework.web.service.invoker.HttpServiceProxyFactory;
//
///***
// * @title HttpInterfaceConfig
// * @description
// * @author woo hua
// * @version 1.0.0
// * @create 2022/12/16 11:23
// **/
//@Configuration
//public class HttpInterfaceConfig {
//
//    @Value("${remote.baseUrl}")
//    private String baseUrl;
//
//    @Bean
//    WebClient webClient() {
//        return WebClient.builder()
//                //添加全局默认请求头
//                .defaultHeader("source", "http-interface")
//                //给请求添加过滤器，添加自定义的认证头
//                .filter((request, next) -> {
//                    ClientRequest filtered = ClientRequest.from(request)
//                            .build();
//                    return next.exchange(filtered);
//                })
//                .baseUrl(baseUrl).build();
//    }
//
//    @Bean
//    CommonApi umsAdminApi(WebClient client) {
//        HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(client)).build();
//        return factory.createClient(CommonApi.class);
//    }
//
//}
